package com.lanyou.esb.cook.proxy.meta;

import java.rmi.NoSuchObjectException;

import org.apache.commons.lang3.StringUtils;

/**
 * 跟踪日志是否开启<br>
 * 描述：<br>
 * 0：关闭；1：开启；
 * 
 * @author Davey.wu
 */
public enum TraceType {

	CLOSE("0"), OPEN("1");

	public static final String TypeCode = "20009";

	public final String ValueCode;

	private TraceType(String code) {
		this.ValueCode = code;
	}

	public static TraceType get(String valueCode) throws NoSuchObjectException {
		if (StringUtils.isEmpty(valueCode)) {
			throw new NullPointerException();
		}
		for (TraceType type : TraceType.values()) {
			if (type.ValueCode.equals(valueCode)) {
				return type;
			}
		}
		throw new NoSuchObjectException(valueCode);
	}
}
